package com.bank.model.vo.login;

import com.bank.model.entity.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author Cejay1314
 * @version 1.0
 * @create 2023/3/20 16:34
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class PersonalInfoVo {
    long userId;
    String username;
    String sex;
    String headPortrait;
    String phoneNumber;
    String role;
    String roleDescription;


    public PersonalInfoVo(User user, Role role) {
        this.userId = user.getId();
        this.username = user.getUsername();
        this.sex = user.getSex();
        this.headPortrait = user.getHeadPortrait();
        this.phoneNumber = user.getPhoneNumber();
        this.role = role.getName();
        this.roleDescription = role.getDescription();
    }

}
